package com.server;

import com.alibaba.fastjson.JSONObject;
import com.proj.Game;
import com.proj.GameList;
import com.proj.User;

public class GameServer {
    //发送消息
    public  static  void sendMsg(String userName,String gameId,JSONObject msg){
        Game game=GameList.getGameById(gameId);
        if(game!=null){
            game.setAMsg(msg);
        }
    }
    //获取消息
    public  static  JSONObject getMsg(String userName,String gameId){
        Game game=GameList.getGameById(gameId);
        if(game!=null){
            return game.getAMsg();
        }
        return null;
    }

    public static void quitGame(String userName){
        GameList.quitGame(userName);
    }
}
